/**
 * Created by ZFL on 2017/11/20.
 */
/**
 * Created by ZFL on 2017/11/16.
 */
var vm=new Vue({
    el:'#paySuccess',
    data:{
        Cashcoin:''    //现金币
    }
})
function appInit(){
    PageInit()
}
function PageInit(){
    if($.getPara('status')){
        showBg();
    }


}

//点击拆红包 领取现金币
$('.removeRp').click(function(e){
    getCashcoin()

})





//点击查看  关注微信公众号
$('.receiveRp').click(function(){
    $('.receiveRp').hide();
    closeBg();

})


//得到现金币
function  getCashcoin(){
    $.ajaxHandler({
        model:function(){
            var obj={};
            obj.channel=1;
            obj.userId=JSON.parse($.getStorage('xm_uData')).userId;
            console.log(obj)
            return obj;
        },
        visibleTime: 0,
        visible: 'show',
        approve: true,
        api:"/yg_baijiaapp/userBank/luckyPrize",
        success:function(res){
            if(res.code==10000){
                vm.Cashcoin=res.data;
                $('.removeRp').hide();
                $('.receiveRp').show();

            }
        }
    })
}


//显示灰色 jQuery 遮罩层
function showBg() {
    var bh = $(window).height();
    var bw = $(window).width();
    $("#fullbg").css({
        height:bh,
        width:bw,
        display:"block",
    });
    $("#dialog").show();
    $('body').css("overflow","hidden")

}
//关闭灰色 jQuery 遮罩
function closeBg(){
    $("#fullbg,#dialog").hide();
    $('body').css("overflow","visible")
//        location.href ='/b2c/app/downloadApp.html';
}

//点击领取并查看   进入微商城
function goMall(){
    var url=$.wxApi()+'?status=0';
    window.location.href=url;
}

